/**
 * @FileName: PackageAuthController.java
 * @Author
 * @Description:
 * @Date 2017年6月14日 下午2:46:51
 * @CopyRight ZTE Corporation
 */
package cn.hpclub.server.controller.admin;

import java.util.concurrent.ConcurrentHashMap;

import cn.hpclub.server.model.Package;
import cn.hpclub.server.service.ThemesService;

public class PackageAuthController extends BaseAdminController<Package>{
    private static final String HTML_AUTH_MAIN     = "/admin/package_auth_main.tpl";
    private static final String HTML_AUTH_ADD_MAIN = "/admin/package_auth_add_main.tpl";

    /**
     * @Title: list
     * @Description:主题列表界面，包含搜索和分页
     */
    @SuppressWarnings("static-access")
    public void list(){
        ConcurrentHashMap<String, String> searchInfo = getSearchInfo();
        // type=5为政企专区，如果以后5-10都是政企专区，则需要修改type条件
        findByPageForSearch("select *,(case when type=0 then '外链' when type=1 then '开户' when type=2 then '充值缴费' when type=3 then '实名补登记' when type=5 then '政企专区' end) as type_text ",
                            ThemesService.service.getSqlExceptSelect(searchInfo));
        setAttrs(searchInfo);
        render(HTML_AUTH_MAIN);
    }

    /**
     * 新增
     */
    public void add(){
        render(HTML_AUTH_ADD_MAIN);
    }

}
